<template>
  <div>
    <van-nav-bar :title="name" left-arrow @click-left="$router.back()" />
  </div>
</template>

<script>
import { getMusic } from '@/api/music'
export default {
  data () {
    return {
      name: ''
    }
  },

  created () {
    this.getMusicDetail()
  },

  methods: {
    async getMusicDetail () {
      try {
        const res = await getMusic(this.$route.params.id)
        // console.log(res)
        this.name = res.data.songs[0].name
      } catch (err) {
        console.log(err.message)
      }
    }
  }
}
</script>

<style scoped lang="less"></style>
